package com.neusoft.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class configBean {

    @Bean
    //配置负载均衡 实现RestTenplate
    /*
    * 负载均衡的算法接口
    * IRule
    * AbstractLoadBalancerRule  过滤掉跳闸的，访问故障的服务，之后轮询
    * RandomRule 随机
    * RoundRobinRule 轮询
    * RetryRule 重试
    * */
    @LoadBalanced //ribbon
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }


}
